<?php
/**
 * Created by IntelliJ IDEA.
 * User: ruo
 * Date: 2016/12/25
 * Time: 下午9:43
 */

namespace app\index\controller;
use think\Request;

/**
 * Class Base
 * @package app\index\controller
 *
 *
 *
 * 数据api与controller同 control跳转后缀html 使用view 返回
 *
 */
class Base
{

    function  getParam(){

       $request=Request::instance();
        return    ($request->param()['date']);
    }

    function  response($res){



        if ($res==null){


            return json_encode(array(

                "status"=>0,
                'msg'=>'数据为空'



            ));

        }else{

            return json_encode(array(

                "status"=>1,
                'date'=>$res



            ));


        }





    }

   public function  responseFail($msg){

       return json_encode(array(

           "status"=>0,
           'msg'=>$msg



       ));


   }


}